package com.aaa.controller.tables;

import com.aaa.dao.TurnoverDao;
import com.aaa.dao.TurnoverMapper;
import com.wsc.entity.Turnover;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("turnover")
public class TurnoverController {
    @Resource
    TurnoverMapper turnoverMapper;
    @Resource
    TurnoverDao turnoverDao;

    @RequestMapping("select")
    public List<Turnover> select(){
        return turnoverMapper.selectList(null);
    }
    @RequestMapping("insert")
    public Integer insert(Turnover turnover){
        return turnoverMapper.insert(turnover);
    }
    @RequestMapping("update")
    public Integer update(Turnover turnover){
        return turnoverMapper.updateById(turnover);
    }
    @RequestMapping("delete")
    public Integer delete(Integer turnoverId){
        return turnoverMapper.deleteById(turnoverId);
    }
    @RequestMapping("selects")
    public List<Turnover> selects(){
        return turnoverDao.selects();
    }
}
